#ifndef __defs_h
#define __defs_h
#include <stdbool.h>

#ifndef NDEBUG
#define PROFILING
#endif

#define ARMV5

#define VSYNC

#define UNUSED(x) ((x)=(x))

#ifndef ABS
#define ABS(x) (((x)>=0)?(x):-(x))
#endif

#define NOF_ELEMENTS(array) (sizeof(array)/sizeof(*(array)))

#ifndef min
#define min(x,y) (((x)<(y))?(x):(y))
#endif
#ifndef max
#define max(x,y) (((x)>(y))?(x):(y))
#endif

#define FILENAME_LENGTH 256

/* use our XScale-optimised routine for moving/copying memory */
#define memcpy  copymem
#define memmove copymem

#ifdef __cplusplus
extern "C" {
#endif
void *copymem(void *d, const void *s, size_t n);

/* specialised memory-fillling routine
   d must be word-aligned, n must be 64m where m >= 1 */
void *fillmem(void *d, int w, size_t n);

#ifdef __cplusplus
};
#endif

#define VERSION "0.11"


#define USE_DMA


#endif
